package cn.iocoder.yudao.framework.common.enums.pay;

import cn.iocoder.yudao.framework.common.enums.metal.MetalTypeEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 钱包类型枚举
 */
@Getter
@AllArgsConstructor
public enum PayWalletTypeEnum {

    RMB(0, "人民币钱包"),
    GOLD(1, "黄金"),
    GOLD_BAR(2, "金条"),
    SILVER(3, "白银"),
    PLATINUM(4, "铂金"),
    PALLADIUM(5, "钯金"),
    POINT(6, "积分");

    /**
     * 钱包类型
     */
    private final Integer type;
    /**
     * 钱包名称
     */
    private final String name;

    public static Integer getByMetal(MetalTypeEnum metalType) {
        if (metalType == null) {
            return null;
        }
        return switch (metalType) {
            case GOLD -> GOLD.getType();
            case GOLD_BAR -> GOLD_BAR.getType();
            case SILVER -> SILVER.getType();
            case PLATINUM -> PLATINUM.getType();
            case PALLADIUM -> PALLADIUM.getType();
            default -> RMB.type;
        };
    }
} 